package gps.implementationAPI;

import gps.Colors;
import gps.Direction;
import gps.GPSRun;
import gps.api.GPSState;
import gps.states.SquareState;

public class GPSProblemImplementation extends GPSGenericProblemImplementation {

	public GPSProblemImplementation() {
		super();
	}
	
	public Integer getHValue(GPSState state) {
		Integer countSquares = 0;
		SquareState square;
		for (int i = 0; i < GPSRun.N; i++) {
			for (int j = 0; j < GPSRun.N; j++) {
				square = state.getElementState(i, j);
				if (square != null && !(square.getDirection() == Direction.NONE && square.getFirstColor() == Colors.WHITE
						&& square.getSndColor() == Colors.WHITE)) {
					countSquares++;
				}
			}
		}
		
		return countSquares;
	}

}
